﻿<UserControl x:Class="HeritageAcademy.Library.Controls.TestBoard"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:Controls="clr-namespace:HeritageAcademy.Library.Controls" 
             xmlns:ec="http://schemas.microsoft.com/expression/2010/controls" 
             mc:Ignorable="d" 
             d:DesignHeight="800.5" d:DesignWidth="972">
	<UserControl.Resources>
		<Style x:Key="StartCourseButtonStyle" TargetType="{x:Type Button}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Grid>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualStateGroup.Transitions>
										<VisualTransition GeneratedDuration="0:0:0.3"/>
									</VisualStateGroup.Transitions>
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver">
										<Storyboard>
											<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="rectangle">
												<EasingColorKeyFrame KeyTime="0" Value="#FFEB9032"/>
											</ColorAnimationUsingKeyFrames>
											<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="rectangle">
												<EasingColorKeyFrame KeyTime="0" Value="#FFEB7700"/>
											</ColorAnimationUsingKeyFrames>
											<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Offset)" Storyboard.TargetName="rectangle">
												<EasingDoubleKeyFrame KeyTime="0" Value="0.009"/>
											</DoubleAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Pressed"/>
									<VisualState x:Name="Disabled"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="FocusStates">
									<VisualState x:Name="Unfocused"/>
									<VisualState x:Name="Focused"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Rectangle x:Name="rectangle" Stroke="Gainsboro">
								<Rectangle.Fill>
									<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
										<GradientStop Color="#FF8D8D8D" Offset="0.004"/>
										<GradientStop Color="#FF5E5E5E" Offset="1"/>
									</LinearGradientBrush>
								</Rectangle.Fill>
							</Rectangle>
							<Label Content="Продолжить" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="White" FontSize="13.333" Visibility="Hidden"/>
							<ContentPresenter RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="IsFocused" Value="True"/>
							<Trigger Property="IsDefaulted" Value="True"/>
							<Trigger Property="IsMouseOver" Value="True"/>
							<Trigger Property="IsPressed" Value="True"/>
							<Trigger Property="IsEnabled" Value="False"/>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="TestTitlesListItemStyle" TargetType="{x:Type ListBoxItem}">
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
			<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
			<Setter Property="Padding" Value="2,0,0,0"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ListBoxItem}">
						<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
							<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsSelected" Value="true">
								<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
							</Trigger>
							<MultiTrigger>
								<MultiTrigger.Conditions>
									<Condition Property="IsSelected" Value="true"/>
									<Condition Property="Selector.IsSelectionActive" Value="false"/>
								</MultiTrigger.Conditions>
								<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
								<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
							</MultiTrigger>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</UserControl.Resources>
    <Grid x:Name="grid">
    	<Grid.ColumnDefinitions>
    		<ColumnDefinition Width="0.255*"/>
    		<ColumnDefinition Width="0.745*"/>
    	</Grid.ColumnDefinitions>
    	<Grid.RowDefinitions>
    		<RowDefinition Height="66"/>
    		<RowDefinition Height="154"/>
    		<RowDefinition/>
    		<RowDefinition Height="61.306"/>
    	</Grid.RowDefinitions>
    	
        <!-- Tests titles list -->
        <Controls:TestBoardListBox x:Name="tblbList" Grid.RowSpan="4"/>
    	
        <!-- Testing duration -->
        <StackPanel x:Name="spDuration" Grid.Column="1" HorizontalAlignment="Right" Grid.Row="2" Margin="0" Orientation="Horizontal" VerticalAlignment="Bottom">
    		<TextBlock x:Name="tbH" Text="1" FontSize="96" FontWeight="Medium" SnapsToDevicePixels="True" Foreground="#FFBCBCBC" d:LayoutOverrides="Height"/>
    		<TextBlock x:Name="tbHCaption" Margin="0" TextWrapping="Wrap" Text="час" VerticalAlignment="Bottom" Foreground="#FFBABABA" HorizontalAlignment="Right" FontSize="26.667" TextOptions.TextFormattingMode="Display"/>
    		<TextBlock x:Name="tbM" Text="45" FontSize="96" FontWeight="Medium" SnapsToDevicePixels="True" Foreground="#FFBCBCBC"/>
    		<TextBlock x:Name="tbMCaption" Margin="0" TextWrapping="Wrap" Text="минут" VerticalAlignment="Bottom" Foreground="#FFBABABA" HorizontalAlignment="Right" FontSize="26.667" TextOptions.TextFormattingMode="Display"/>
    	</StackPanel>
    	
        <!-- Start button -->
        <Button x:Name="btnStartTest" Content="Начать" Style="{DynamicResource StartCourseButtonStyle}" Foreground="White" FontSize="16" TextOptions.TextFormattingMode="Display" Margin="0" Width="120" VerticalAlignment="Center" Grid.Column="1" HorizontalAlignment="Center" Grid.Row="4"/>
    	
        <!-- Banner -->
        <Rectangle x:Name="recBanner" Grid.Column="1" StrokeThickness="0" Grid.RowSpan="2" Margin="0" SnapsToDevicePixels="True">
    		<Rectangle.Fill>
    			<SolidColorBrush Color="{DynamicResource SelectionColor}"/>
    		</Rectangle.Fill>
    	</Rectangle>
    	
        <!-- Test title -->
        <TextBlock x:Name="tbTitle" Text="{Binding CurrentTest.Model.Title}" TextWrapping="Wrap" Grid.Column="1" d:LayoutOverrides="Width" Margin="8,0,0,0" FontSize="18.667" VerticalAlignment="Top" Foreground="White" IsHitTestVisible="False" TextOptions.TextFormattingMode="Display"/>
        <TextBlock x:Name="tbDescription" Text="{Binding CurrentTest.Model.Description}" TextWrapping="Wrap" VerticalAlignment="Bottom" Margin="243.68,0,20,72.04" Height="82" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Right" FontSize="13.333" TextTrimming="CharacterEllipsis"/>
    	
        <!-- ??? -->
        <Path x:Name="path" Grid.Column="1" Data="M206.93292,450.01132 C206.93292,450.01132 341.57478,450.91528 415.67303,367.78066 489.77128,284.64604 598.20795,251.21174 702.12629,251.21174" Margin="41.213,27.432,41.874,17.183" Grid.Row="2" Stretch="Fill"/>
    	
        <!-- Ledder -->
        <ec:PathListBox x:Name="plbLedder" Grid.Column="1" Margin="0" Grid.Row="2">
    		<ec:PathListBox.LayoutPaths>
    			<ec:LayoutPath SourceElement="{Binding ElementName=path}" Distribution="Even"/>
    		</ec:PathListBox.LayoutPaths>
    		<Canvas Height="16" Width="68">
    			<Rectangle Width="68" Height="16" d:LayoutOverrides="Height" SnapsToDevicePixels="True" Stroke="#FF1E8729" Margin="0" HorizontalAlignment="Center" VerticalAlignment="Center" RadiusX="4" RadiusY="4"/>
    			<Rectangle Width="34" Height="16" d:LayoutOverrides="Height" SnapsToDevicePixels="True" Fill="#FF1E8729" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Center" RadiusX="4" RadiusY="4"/>
    		</Canvas>
    		<Rectangle Width="68" Fill="#FF393939" Height="16" d:LayoutOverrides="Height" SnapsToDevicePixels="True"/>
    		<Rectangle Width="68" Fill="#FF393939" Height="16" d:LayoutOverrides="Height" SnapsToDevicePixels="True"/>
    		<Rectangle Width="68" Fill="#FF393939" Height="16" d:LayoutOverrides="Height" SnapsToDevicePixels="True"/>
    		<Rectangle Width="68" Fill="#FF393939" Height="16" d:LayoutOverrides="Height" SnapsToDevicePixels="True"/>
    		<Rectangle Width="68" Fill="#FF393939" Height="16" d:LayoutOverrides="Height" SnapsToDevicePixels="True"/>
    		<Rectangle Width="68" Fill="#FF393939" Height="16" d:LayoutOverrides="Height" SnapsToDevicePixels="True"/>
    		<Rectangle Width="68" Fill="#FF393939" Height="16" d:LayoutOverrides="Height" SnapsToDevicePixels="True"/>
    	</ec:PathListBox>
    	
        <!-- Maximum level -->
        <StackPanel x:Name="spMaxLevel" Grid.Column="1" HorizontalAlignment="Right" Margin="0,49.136,0,-23.056" Orientation="Horizontal" Grid.Row="1">
    		<TextBlock Margin="0,0,10,3" TextWrapping="Wrap" Text="максимальный уровень" VerticalAlignment="Bottom" HorizontalAlignment="Right" FontSize="26.667" TextOptions.TextFormattingMode="Display" d:LayoutOverrides="VerticalAlignment" SnapsToDevicePixels="True">
    			<TextBlock.Foreground>
    				<SolidColorBrush Color="{DynamicResource SelectionColor}"/>
    			</TextBlock.Foreground>
    		</TextBlock>
            <TextBlock x:Name="tbMaxLevel" Text="{Binding CurrentTest.Model.MaxLevel}" FontSize="96" FontWeight="Medium" SnapsToDevicePixels="True" Foreground="White" VerticalAlignment="Bottom" Margin="0,0,0,-1"/>
    	</StackPanel>
    	
        <!-- Short statistics -->
        <Grid x:Name="grdStat" Grid.Column="1" HorizontalAlignment="Left" Grid.Row="2" VerticalAlignment="Top" Margin="25,25,0,0" Height="70">
    		<Grid.RowDefinitions>
    			<RowDefinition Height="0.547*"/>
    			<RowDefinition Height="0.5*"/>
    		</Grid.RowDefinitions>
    		<StackPanel x:Name="spAns1" Orientation="Horizontal" Margin="0" d:LayoutOverrides="Width">
    			<TextBlock TextWrapping="Wrap" Text="Отвечали" FontSize="18.667" d:LayoutOverrides="Height" Margin="0,0,5,0"/>
                <TextBlock x:Name="tbAnsQtyAll" TextWrapping="Wrap" Text="{Binding TotalNumberOfAnswers}" FontSize="18.667" Margin="0,0,5,0">
    				<TextBlock.Foreground>
    					<SolidColorBrush Color="{DynamicResource SelectionColor}"/>
    				</TextBlock.Foreground>
    			</TextBlock>
    			<TextBlock x:Name="tbAnsQtyAllCaption" TextWrapping="Wrap" Text="раз" FontSize="18.667"/>
    		</StackPanel>
    		<StackPanel x:Name="spAns2" Orientation="Horizontal" Margin="0" d:LayoutOverrides="Width" Grid.RowSpan="2" Grid.Row="1">
    			<TextBlock TextWrapping="Wrap" Text="Ошиблись" FontSize="18.667" d:LayoutOverrides="Height" Margin="0,0,5,0"/>
                <TextBlock x:Name="tbAnsQtyWrong" TextWrapping="Wrap" Text="{Binding NumberOfWrongAnswers}" FontSize="18.667" Margin="0,0,5,0">
    				<TextBlock.Foreground>
    					<SolidColorBrush Color="{DynamicResource SelectionColor}"/>
    				</TextBlock.Foreground>
    			</TextBlock>
    			<TextBlock x:Name="tbAnsQtyWrongCaption" TextWrapping="Wrap" Text="раза" FontSize="18.667"/>
    		</StackPanel>
    		<TextBlock x:Name="tbAnsWrongNone" TextWrapping="Wrap" Text="Без ошибок" FontSize="18.667" d:LayoutOverrides="Width, Height" Margin="0" Grid.Row="1" Visibility="Collapsed"/>
    		<TextBlock x:Name="tbAnsWrongAll" TextWrapping="Wrap" Text="Всё не правильно" FontSize="18.667" d:LayoutOverrides="Width, Height" Margin="0" Grid.Row="1" Visibility="Collapsed"/>
    		<TextBlock x:Name="tbAnsNone" HorizontalAlignment="Left" TextWrapping="Wrap" Text="Еще не отвечали" Grid.RowSpan="2" VerticalAlignment="Center" FontSize="18.667" Visibility="Collapsed"/>
    	</Grid>
    	
        <!-- Banner image -->
        <Image Margin="0,0,0,-2" Grid.Column="1" HorizontalAlignment="Left" Grid.Row="1" Height="154" Source="/HeritageAcademy.Library;component/Images/TestBoardClipart1.png"/>
    </Grid>
</UserControl>
